#include"etelCore\\Factory.h"
using namespace etel;

void debugger(wchar_t* code,short codeLength,wchar_t* debugInfo){
	SINGLETON_GET(FactoryRegex,factory)

	short lth;
	long loc;
	wchar_t temp[INFO_SIZE];
	Regex* regex=factory->prdRCharRange(code,codeLength,lth,debugInfo,loc);
	if(regex!=NULL){
		regex->dump(debugInfo);
		delete[] regex;
		swprintf_s(temp,L"%s",debugInfo);
		swprintf_s(debugInfo, INFO_SIZE, L"Dump: %s with length %d", temp, lth);
	}else{
		swprintf_s(temp,L"%s",debugInfo);
		swprintf_s(debugInfo, INFO_SIZE, L"Error: %s, at position %ld", temp, loc);
	}
}